<%-------------------------------------------------------------------
 * 页面名称：bankRemitInpour_1.jsp
 * 功能描述：新增或者修改银行充值页面
 * Action: 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%
String path = request.getContextPath();
%>
<link href="<%=path%>/css/sinfo.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/newstyle.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/common.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='<%=path%>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/engine.js'></script>
<script type="text/javascript" src="<%=path%>/js/choiceCity.js"></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/AccountLogic.js'></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/accountTemplate.js'></script>
<script type="text/javascript" src='<%=path%>/js/vnv/commonForManage.js'
	charset="UTF-8"></script>
<script type='text/javascript'
	src='<%=path%>/js/vnv/commonForCnAmount.js'></script>
<script type='text/javascript' src='<%=path%>/js/vnv/tomoney.js'></script>
<script language="JavaScript" type="text/JavaScript">
function update(){
	if($("remitProvinceId").value!=""){
    	AccountLogic.getCityList(createList, $("remitProvinceId").value);
    }
}
function createList(data){
	DWRUtil.removeAllOptions("remitCityId");
	DWRUtil.addOptions("remitCityId", data,"cityId","cityName");
}
function submitProcess() {
	var formObj = document.forms["0"];
	if(checkNecessaryInput(formObj)){
	    if(formObj.remitAccountNo!=undefined){
			var remitAccountNo = formObj.remitAccountNo;
			var accountNo = remitAccountNo.value;
			var regv=/^(\d){6,32}$/ ;
			if(!regv.test(accountNo)){
				alert("请输入正确的汇款人账号，账号只能为6到32位的数字！");
				remitAccountNo.value="";
				remitAccountNo.focus();
				return; 	        			
			}
		}
	    if(formObj.remark.value.length>85){
			alert("备注长度不能大于85！");
			return;
		}
		formObj.submit();
	}
}
function kd(){
	var ss=getObj("amount").value;
	ss = ss.replace(/ /g,"");
	if (ss=="") {
		getObj("upperAmount").value="";
		return;
	}
	
	var sDispMsg = getChineseCurrencyString(ss);
	if(sDispMsg==-1) sDispMsg="错误的金额!";
	if(sDispMsg==-2) sDispMsg="太长的金额!";
	getObj("upperAmount").value=sDispMsg;
}
function updatePrompt(data) {
}
</script>
<div id="mainFrame">
	<div class="rightSider2">
		<div class="sub_title">
			<span class="bluefont18bdrop"><logic:notEmpty
					name="BankRemitInpourForm" property="transId">修改</logic:notEmpty>银行汇款充值</span>
		</div>
		<div class="edit_pass">
			<html:form method="post" action="bankRemitInpour">
				<html:hidden property="step" />
				<html:hidden property="actionType" />
				<html:hidden property="transId" />
				<table width="100%" border="0" align="center" cellpadding="5"
					cellspacing="1">
					<input type="hidden" name="bankId" value="0" />
					<input type="hidden" name="step2" value="1" />
					<input type="hidden" name="actionType" value="B2cNetIn" />
					<tr>
						<td width="23%" align="right">
							充值子账户：
						</td>
						<td width="77%">
							<div class="select">
								<div>
									<html:select property="subAccountId">
										<html:options collection="subAccounts" property="accountId"
											labelProperty="accountName" />
									</html:select>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td align="right">
							<span class="orang12b">*</span> 充值金额：
						</td>
						<td>
							<html:text property="amount" alt="充值金额" size="50"
								styleClass="inputStyle"
								onblur="if(checkDecimalInput(this,0)){accountTemplate.ifAccountIsEffect(this.value, updatePrompt)} ;tomoney('forms[0]','amount','hideTransAmt');kd();"
								onkeyup="kd();" onchange="kd();" />
							元 &nbsp;&nbsp;
							<img src="<%=path%>/images/money.gif" width="17" height="17"
								border="0" style="cursor:hand" title="请使用计算器，计算充值金额"
								onclick="amountSelect();" />
							<input type="hidden" name="hideTransAmt" value="" />
						</td>
					</tr>
					<tr>
						<td align="right">
							充值金额大写：
						</td>
						<td>
							<input name="upperAmount" type="text" class="inputStyleNoborder"
								size="50" style="background:#F6F6F6;" readonly />
						</td>
					</tr>
					<tr>
						<td align="right">
							<span class="orang12b">*</span>收款银行：
						</td>
						<td>
							<div class="select">
								<div>
									<html:select property="collectBankId" alt="收款银行">
										<option value="">
											----请选择收款银行----
										</option>
										<html:options collection="collectBankList" property="id"
											labelProperty="name" />
									</html:select>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td align="right">
							<span class="orang12b">*</span>汇款银行：
						</td>
						<td>
							<div class="select">
								<div>
									<html:select property="remitBankId" alt="汇款银行">
										<option value="">
											----请选择您的汇款银行----
										</option>
										<html:options collection="remitBankList" property="id"
											labelProperty="bankName" />
									</html:select>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td align="right">
							<span class="orang12b">*</span>开户行省份：
						</td>
						<td>
							<div class="select">
								<div>
									<html:select property="remitProvinceId" onchange="update()"
										alt="开户行省份">
										<option value="" selected>
											----请选择您的开户行省份----
										</option>
										<html:options collection="provinceList" property="cityId"
											labelProperty="cityName" />
									</html:select>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td align="right">
							<span class="orang12b">*</span>开户行城市：
						</td>
						<td>
							<div class="select">
								<div>
									<select name="remitCityId" alt="开户行城市">
										<option value="" selected>
											----请选择您的开户行城市----
										</option>
									</select>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td align="right">
							<span class="orang12b">*</span>开户行名称：
						</td>
						<td>
							<html:text property="issuingBankName" alt="开户行名称" size="50"
								maxlength="40" styleClass="inputStyle" onblur="killSpace(this)" />
							(最多40个汉字)
							<br />
							<table width="94%" border="0" cellpadding="5" cellspacing="1"
								bgcolor="#f9e277" style="margin:10px 0;">
								<tr>
									<td class="font_gray">
										请务必
										<span class="text9green">正确填写</span>您的汇款银行开户行的详细信息！如果您不填写或者填写不正确，当充值过程发生意外时，将会导致您的充值资金无法正常退回您的汇款帐户！
										<br />
										此处
										<span class="redColor12px">无需</span>重复填写银行名称与省市，
										<span class="redColor12px">只需</span>填写具体名称。如：海淀支行海体分理处。
										<br />
										如果您无法确定您的银行卡的开户名称，您可以
										<span class="text9green">致电相关银行客服</span>，报出您的卡号，即可获得开户行信息。
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<logic:equal name="corpAccount" value="true">
						<tr>
							<td align="right">
								<span class="orang12b">*</span>汇款人名称：
							</td>
							<td>
								<html:text property="remitterName" alt="汇款人名称" size="50"
									maxlength="64" styleClass="inputStyle" onblur="killSpace(this)" />
							</td>
						</tr>
						<tr>
							<td align="right">
								<span class="orang12b">*</span>汇款人账号：
							</td>
							<td>
								<label>
									<html:text property="remitAccountNo" alt="汇款人账号" size="50"
										maxlength="32" styleClass="inputStyle"
										onblur="killSpace(this)" />
									(为数字，且长度应该在6位到32位之间)
								</label>
							</td>
						</tr>
					</logic:equal>
					<tr>
						<td align="right">
							备注：
						</td>
						<td>
							<label>
								<html:textarea property="remark" cols="35" rows="5"
									style="border:1px solid #ccc;" />
								(最长85个字符)
							</label>
						</td>
					</tr>
					<logic:present name="org.apache.struts.action.ERROR">
						<tr>
							<td align="right">
								&nbsp;
							</td>
							<td height="25" class="twoSiderLine">
								&nbsp;
								<font color="#FF0000"><html:errors />
								</font>
							</td>
						</tr>
					</logic:present>
					<tr>
						<td align="right">
							&nbsp;
						</td>
						<td>
							<input name="button2" type="button" class="button_style"
								onclick="submitProcess();" value="下一步" />
						</td>
					</tr>
				</table>
			</html:form>
		<table width="100%" border="0" align="center" cellpadding="7"
										cellspacing="1" bgcolor="#f9e277" style="margin:10px 0;">
										<tr>
											<td bgcolor="#fffdf5">
												<table width="100%" border="0" cellpadding="3"
													cellspacing="0">
													<tr>
														<td width="3%" height="25" valign="top"
															style="border-bottom:1px solid #ccc;"></td>
														<td width="97%" align="left" class="red12b"
															style="border-bottom:1px solid #ccc;">
															特别提醒
														</td>
													</tr>
							<tr>
								<td valign="top">
									&nbsp;
								</td>
								<td align="left" class="font_gray">
									请您先
									<span class="text9green">输入汇款明细</span>，再到银行
									<span class="text9green">填写汇款单</span>进行汇款，谢谢！
								</td>
							</tr>
							<tr>
								<td valign="top">
									&nbsp;
								</td>
								<td align="left" class="font_gray">
									支付账户
									<span class="redColor12px">不允许</span>进行虚假交易、银行卡转账套现或洗钱等被禁止的交易行为，
									<span class="redColor12px">否则</span>充值款项将不能提现。
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
	</div>
</div>
<script type="text/javascript" src="<%=path%>/js/layer.js"></script>
<script language="JavaScript" type="text/JavaScript">
function closeLayer(returnValue, type){
	hideLayer();
	if(type=="amount"){
		document.forms[0].amount.value=returnValue;
		document.forms[0].amount.focus();
		kd();
	}
}

function amountSelect(){
 	agiledata.getUserInternal(amountPopup);
}

function amountPopup(data) {
  	if(data) {
	 	openLayer("<%=path%>/page/common/simpleCalculator.jsp",400,200,false);
	} else {
		location.href="<%=path%>/page/util/session_invalid.jsp";
	}      
}

function setRemitCityId(v) {
	if (v!=null && v!='')
		document.forms[0].remitCityId.value = v;
}

//显示预先设置的金额的大写
kd();

//显示预先设置的开户行城市
if ('<bean:write name="BankRemitInpourForm" property="remitCityId"/>'!='') {
	update();
	window.setTimeout('setRemitCityId(<bean:write name="BankRemitInpourForm" property="remitCityId"/>)', 500);
}

</script>
